package com.example.springboot09.danlimoshi;

import jdk.nashorn.internal.ir.IfNode;

/**
 * @ClassName LazyMan
 * @Description TODO
 * @Author tianqinglong
 * @Date 15:26 2022/7/25
 * @Version 1.0
 **/
public class LazyMan {
    public static void main(String[] args) {
        LazyMan instance = getInstance();
        LazyMan instance1 = getInstance();

    }

    private LazyMan(){
        System.out.println("懒汉式");
    }
    private  static LazyMan lazyMan;

    public static LazyMan getInstance(){
        if (lazyMan==null){
            lazyMan= new LazyMan();
        }
        return lazyMan;
    }
}
